work out 1007, be careful with the requirement about output