Total refactoring while extending program functionality using HackBulgaria's polyglot for ideas