Cleaned up buffer usage and added dynamic file path