phase 5 (fixed bugs, without events)