Need help with a Custom empty? function

You were given a good start. You can do the rest easily.