ok, so it turns out it had nothing to do with the vector code above. Using the debugger properly as you suggested I was able to see exactly where it was screwing up. Thanks.