Adding the combined code: Version1