Extensive update

needs testing.