logic changes in .rb