N-body ruby implementation