widget backend functionality!

(almost done)