Removed some redundant lua tests, starting C implementation