Changed widget code a bit