copied setupv2 from master (OSX)