modified simple.R