Finished conversion, logical bug still exists.