Added some functionality which in the end was not needed.