better comments, minor improvements