Change from Ruby to C