added constants, removed console.log debug stuff