finished coding for v2.0