removes unused import
adds native support for tail and removes unused helper function