fixed bugs, code compiling now