updated
renamed and added comments