Modified Trannoy script