fixed bugs and implemented more stuff