python + algebra. this sucks. really. just a few python functions that should NEVER be used, for god's sake