p7 done in ruby