Some problem in logic but ok