Created classes to handle graphs