ruby code used for wipi