Mid Function
Mid function