Fixed bugs with adding weights and creating the initial line graph