Working copy. Please review it and check it's correctness for assurance.