reviewed w/ small fixes