update after James' suggestions