misc. changes
added validate and sort