Debugged and added indicator light function