do not know why it gives the wrong solution