Moving code to correct spot