Add validation routines - needs testing