When running this program I seem to get a seg fault core dumped error. As far as I know a seg fault is caused by trying to access something out of bounds so I am not sure wh