merge with old code