Rewritten the entire program almost from scratch.