added type switch for booleans and integers