ok so modifing some of the old code here so it works is this the right way to do it