added closure to result datatype