updated code for the gingerbread