changes as per review and changes as reset function removed and self changes to var