Working version with afmotion 2.4.1