New graph parsing(should work better I hope)