v1 works for naive cases
main func