Updated code to work towards integration