Implementation of challenge 2