fixed many things and added search