extensive update

needs testing.