Refined klotski haskell program, but it's too slow