Pure c

Added C version of REK