added missing assertions & code format