Solution to issue 6