#24 fixed buffer positioning