Added search function and messed with db