work and bug fixes