convertes improved and generalized