trying an automatic function
auto code