changed to cpp for ease of io