fixed unnecessary instance variables and made some lines more ruby-esque