Works for input size 2