removed repeat codes and your insternal structure reorganized