a first version that gives WA
still producing wrong answer