code added to functions