output appears to be correct. fixed some formatting and removed unneccessary vars