at function: clean up, add example