using assert instead of Panic

I implemented assert, I'm not sure on the rules on using NDEBUG, but don't try to add that in to this file or it'll break the build. The assert gives also gives the expression which should help with debugging.