Create Where.php

separate functions for improved performance and organization