Graph updated to work on any number of branches and organise by brach & color