some code to enable/disable the calculate button properly