made both functions seperate