add returnHomePage function and finished basic functions.