Added some commentings. Removed some useless code.