implemented working search