changed back to shell and updated write