updated core functionality and comments.