added exit and getsize