add decimal handling and primary_key function