added a lot more comments