Updated code for compilation