Made function good

Made function better