removed tmp variables