Fork of WAFO code from https://code.google.com/p/wafo