Added Professor Samson's updated search code