use std::array for array
change the type of varying argument to const