Simplified checks and added comments to 'extrapolateCoordinates()'
Fixed imports, added tests and fixed bound check