Replaced while loop with algorithm's count function. Very useful. Requires a blank line at the end of the services file.