Added comments, removed useless code.