Added a few functions. Vectorized padVariable.