Ruby code attempting to solve varying ruby challenges