fixing stupid errors (counting)