Code for academic purposes.