finished steps 3 and 4, fixed for non-nominal values