Added Debug mode
Done too many things to list here