fixes bug- colMedians cannot be applied to data.frame, so coerces to matrix