use better enum syntax
use foldl' and split func that actually works on strings