U can improve it... use variables to store the info, check for $modespl, and set separate lines if it exceeds etc...