add end and home functions