Added names to graph bars and abstracted resorting for parts to test if it works