working but in a wrong way, number is half less counted