Replaced deprecated split() with explode()