Changed from recursive to itterative
Some docs, code simplification.