Complete the logic