fixed bugs / cleaned up