added some enemy intersections check, reformatted the code to make it more object-oriented and fixed some minor bugs