Change new() functions to take references to Vec.
Added unit tests