added modified function