take this in another direction. just the ruby logic