changed fork, added third mode