Edited by mike652638, Inspired by Task 279 on FreeCodeCamp