works. remove unused xstream stuff