added arrayOf check. made demo more dynamic. fixed model generation when array is given