working for size of 3