refactored

all implementations use arraylists.
an interface will be provided to get arrays.