Fixed up the logic for figuring out if an element within angle range of the required direction