removed commented out canWrite function