adding functions, and fixing the warning