Updated to unit function