improved tsd generation... sort of