Changed a lot of minor things and cleaned code