moved procedures into their own function
adjusting measurements
incorporated covarep