Push to v135696

Rewritten code a bit, made some things more clear. Still not working