Refactored. Took out mod and mask bit finder calls from main.