Reworked version.