All done, needs comments and maybe a complete redo