Implement solution 1 for bug #21