change motivation, fix pascal code