Improved/slightly generalized method