Adapting Trannoy script
Modified Trannoy script