another attempt. learning the ruby nil thing