added and tested constructor with array