fixed a typo and did some slight code cleanup