shuffle some code around that wasn't where it should be