improved performance for westOf function for large datasets