Changed function logic according to fn name