Included old Pascal code from Phase 2