update, cleaning and bug fixing