Change create object funtion
Reformatted provided code
Merge branch 'fixing_createobject'