changed some variables to defines