working on z buffer