quick&dirty in py. takes 4s