fixed most of the rest of the bugs