Theory Behind The Flame Test