replace count with length