previous commit had bug that I could not squash so I reverted it and added some comments