added snaphot functionality