Commited initial rewrite