Fixed an error and added an additional function.