Refactor to remove an almost exact copy of evalLine

Now pass Boolean to evalLine to indicate whether to print out result
Standardize indentation