edited if statement to check for bool, float etc.
added to check for scalar
adjusting grouping