define frames and count