major functions finished