array solution now compiling