Implement and bugfix cambuffer and unit test