using dynamic weights + can spesify output format (graph, table or plain)