implemented push foreach function
added reset functions