cleaned to array function