finish basic functions for web assembler