cleaned code up a little bit