copied changes from erik