moved define statements to top