so far, complete all codes but UI.