(#15) - use binarySearch instead of linear search