Rewrote _getEndLocation function for better readability 

Added offset as argument in function itself rather than doing the math outside and passing in with headerHeight argument.