code styling and fixed a bug