[FIXED] bugs, integrated codes