cleaned some code up