Added comments and a lot of fucking bugfixes