added click and total calculation