Rewritten and simplified