reading from file and working end to end now