How do gems work?