updated add method, created junit + tested index out of bounds