rewrite for better understanding