added a lot of comments