implemented ex1 and ex2. not tested yet fully. need for some
parameterization