DEBUG is TRUE, and moved libraries to top of module for clarity