finished implementation of ArrayList