updated: comments and code