Updated code to match specification version 0.9