Fixed some bugs, but it stills doesn't work