fixed bugs, still buggy