made some adaptations