adding some comments and documentation