updated comments and documentation