updated code for Pebble SDK 2 Beta2.