created disp from array function