changed to use <<- operator in setInv