improved structures and added circula buffer