Added functionality to the functions