put clear arrays inside a function