Added a lot more functionality. Basically works, but needs better graph library