Added javadoc and support for arrays