array replaced w/ list, algo details added