merged Tobi's work