Calculate transitions with more detail
Fix syntax errors