updated some search functions
updated and implemented rules