Changed implementation to truncate y values in buffer