Final

Completed loop, function, wrote and formatted output.
Changed file name to comply with assignment