updated documented code for battle #4