Reorganizing code, created ffi module
Added small comment