Complete comments and working code