Adapted ground line snake algorithm slightly