wrote in ruby and a little jquery