Changed how near is calculated - Fixes #271

Also removed whitespace.