he grabbed a plank of wood from a pile nearby and started to wave it around in front of him , to the utter amazement of the girl and then to the astonishment of mcadams who had just arrived behind frederick .