switched the varsn functions from case expressions to fromMaybe