located the bug- nextUsed() never returns -1