implemented weighted part of graphs, also converting tabs to spaces in all files
bit of restructuring, still converting tabs to spaces