added writing the file
added comamnds