Add record and search functions

search functions were written by Edwin Heung