added -v, made functions static