Halfway commented and maybe some major improvements if I forgot to commit those already