added functionality for primitive arrays