added lots of comments and annotations