Refactored single vector writing into function
DC/AC measure done. Untested