Code cleanup and input documentation. Closed #8