Added support for sending array of states into function

Signed-off-by: Frode Marton Meling <fm@saltship.com>