Continued rewrite, could not check if even compiles
Some fixed, still some error, have to investigate further. Still pushing, DO NOT PULL