Refactored cnv.pl. Added second subroutine