implemented tests, random array builder, and some comments and formatting