Updated documentation and code
Reverted is.bad and reorganized source files