Added Form widget and formatted the code.