Added some comments and switched to using Vectors

Using vectors instead of arrays in order to be able to use generics.