Rewritten vector and square functions, created box and vector_p functions