Trying to create my own write function
Improved error checking
Added getiing argv integer
Added read prototype