for the Rally coding problem given to me