stack verison of indexed datatype works now