bugfiksing i speedFunction metoden