Renamed variable and refactored a few if assignments to terniaries
Added method doc