Changed functino API to var assignment.