Changed every 'exit' to 'return' and set it 0 or 1