refactored into separate files, still have weird issue with lookahead solver