modified all primitive functions