Completed code as per the comment