my answer for rubywarrior