cleanup Vectorize
use "linear" package for some basic stuff