editied some functions