refactored code to change vmins into %