fixed another issue, cleaned code up