Transision function added

Still need to test if it works :)