edited and added snippet