Updated code for v1