Cleaned up, fixed bugs