updated code for cubie