I gang

code fix and enhancements in PHP