add some comments; move some stuff around