New versions of code, updated 5/22/13