some changes based on feedback from @kalmanolah