almost completed, need to test php script