First draft code from estimote sdk