Final code before using Yulia et al 2014 features