updated inline documentation

and more importantly made it work