added base js for arbutrary generic functions