fixed issues w/ extra whitespace in input and worked on selection logic