forgot to create inside and total variables