Made the base for the attacking method, streamlined the program and
added more error messages