major tweaks, almost everything is handled with pointers