more updates, foreach works again, need to update dynalloc function to utilize it properly