Finally implemented compound search