fixed bugs, found new ones