Make code human readable

It took me 15 minutes to understood what happens in that fancy ruby code... I think mine does the same thing and is more readable?

This is **untested** and I do not have test environment for it, but it should do exactly what is supposed to do.

Also this is only kind of proposal..