added array code
remove dead code