fixed some counting errors