solve is working but very very slow