added count function for multiple markings