Rewrite geometry stuff