Deleted a few newlines, made it a little more readable
Converted join and split to shorter versions