added transition class and updated code