added support for arrays of size 1 and 2