merged Sasi's reflection code :)