add the code and useful commentary