first complete version of the axis layout code