Rewored how I calculate band gap