Rewrite attempt 2