simplified pascal code