updated constructor to handle increased data array size