Implemented logic for solution to part 1a

Still needs file output code