Changed counts to a map instead of an array