On z-submonoids and z-codes