added some inline documentation