added vw, vmin, and vmax function along with making the whole thing more modular