added basic buffer mapping stuff