finish most part of the code