update with code and comments