add cmake
implemented general factors
speedup parsing