//edited main and some functions