count needs to be declared outside function in case it's not called