add comment and clean up a bit