added many things to the major functions