updated with more comments