C based, optimised ramsurf implementation