added ability modifier calculator function and made the code cleaner and easier to read