Modify funstion working