second version; finish most function
2nd