placed variables in function