organizing and bug fixing