Impl some data structure to check the possibilities