Code less ugly; answers updated;