changed: the code is a little neater and smaller"