Small changes to the functions