code for M2M platform