based on tests, code will be updated later with pointers since i do need them after all, also need bound checks