added prime search algorithm