Commenting the code, fixed a few usability problems