A first working Version of the Rate function.