removed newlines in each read & about to implement helper function