changed my function