Added counts, and fixed updating