Implemented batch writes