Finished Work on distance - damage code