Added a more DE-agnostic version.