An open source implementation of smartquant.dll