finish most of functions and features