small amount of cleanup and changed MAX_HAZARDS to 5