Updated code from 2/38/14