Inserted comments in all the code + last tweaks