raise error for scalar values
move tests into class