Implement the logic