Fixed coding convention. Added 'valid' function to logic namespace. Fixed failing test case.