removed some exits and printf