added settings page and some functions on it