Adding Debug and Local mode. Cleaning Up