Fixed some bugs. Still not working