upgraded source for ex4-sw1