this is going to need work on exception handling, but right now it's so inconsistent that it doesn't matter anyway.