fix whitespace and -h handling. implement sparse trees