Added comments, some fixes