merge in generalized code