Updated version from OP