I have little clue what samples should look like.  I just cut and copied this into a new function.  All I know is that it supports the same thing it did before.