CG HW5 functionality done, I/O formatting is not finished though.