WPF: added resize. cleaned up a bit