helper functions for arrays
figure functions