bug fixes from having to leave in the middle of working on this