added buffer and window functions