fixed it and cleaned code a bit up