ruby logic not going through yet