improved window sample 2, fixed agenda sample 1