design changes and bug fixing