cleaned up, loop replaced by built-in tools