remove problem 1, 2 and 3
merge problems 1 and 4.
move events to top level