updated with a function call to make things clearer