handle int and float numbers
fix bug that incorrectly marks 'keys' as 'values' and also add a comprehensive test