Replaced line of sight algorithm with a more accurate version.