Works faster now with generator for compounds