edited some functions