Changed some functions