More comments and documentation