Changed code slightly.