changed currentLength variable name, updated add()