consolidated old code with new on RWH