added distance transform