fix bugs
fix ifdef guards name
improve function name
fix
fix bugs