improved ruby file