Fixed some stuff (me being stupid). Made some declarations private