yes, the above code seems like the right approach.