simulate in an own function