removing demo code and adding a search function