clean up/fix the code I should not have deleted