latticePaths script