added test partial and bug fixes