add comments
move fn to outer scope