fixed some of the bugs from merge conflicts