needs sorting and validation