created functions using submit buttons