fixed some severe pointer confusion :)