checkpoint: almost done up to functions&procedures