Code completed for equations in paper