more commenting and documentation