trim code before using it, accept whitespace on input