Added comments, removed useless variables