this is a change from Frank
fix the merge
make it a function