Edited some functions