Clarified calc variables; outline of code