cleaned code and fixed some stuf