Search modified

Search has been modified as per the new conditions. The constraints have been removed and everything has been moved to classes.