I never thought about pre-calculating possibilities and storing them for later use. This is a great optimization technique that I'll definitely keep in mind for future projects. tks bro