remove elses
rewrite functions so they don't use regexes

for speed increase apparently
Add semi colon after function
check trim against false using empty string being falsey