updated home function