Changed prints to function calls