Made some optimizations and fixed the typing for output and accounting. Removed functions that were stupid as shit... Will........ I left getType as a consolation prize though.