First version as part of Master's thesis completion