First draft (writing gem c extension)