Added inline documentation for code