Adaption for code for paper