flowchart how a gold mine works