changed method of getting input, organized file