closes #194, cleans up code