main_fbw.c ported