implementing tests and demos, greatly updated validateCustom