Graph Plot and Code cleaning