fixing bug with compilation by adding an adapter for the function cast (omg i liek totally knows c naw)