removed some things from function