initbuffer and initelementsbuffer