Replaced Riasel with own solution