Code for generating steps. Test case to follow.