Added function, fixed other functions.