simpler version of previous patch