Finished csearch, not sure if it works