Added functionality for finding the number of connected components in the graph and also fixed an issue with parsing.