moved some variables to defines