Move uncompleted algorithms from Python and Java over to C