First version in flat PHP