created widget functionality