Updated code used for accepted version of paper