added premotion, postmotion and fixes for 2 basic examples