Moved hardcoded buffer sizes to #defines