cleaned up, fixed small bugs