code organizing, added reset view button