finish major functions and views