More updates
Complete rewrite