Create Where.php

separating functions to improve performance and organization