Help with JS for traffic light. Also fixed spacing in file

I adjusted the spacing which is why it looks like almost the whole file was changed. Take a look at the comments for help.