changing my solution for an elegant solution found on the provided
answer.