A bit better DSA implementation