changed splitString to be more dynamic nature thanks to abnercoimbre.