added a couple of methods to avoid accessing self.table all the time, optimization of solve1 is mostly finished
misc bugfixes
Optimization done for now. Need to clean up the code.
cleanup