Code for research paper