planning works but is slow as fuck
add hashing for minimal improvement