added some validators
changed count() to len to match sort interface