created major functions