First problem is the +, should be << to append a scalar to the array, not add arrays.