Use pattern matching on tuples instead of ._1 etc.
ticks are of type Any, not ActionEvent.
Make transition functions non-anonymous.