switching from handling dynamic arrays myself to using vectors