more work and bug fixing