Implementation attempts 1 & 2.