merge the old code