Added debug modes, cleaned files up a bit