Formatting / Refactoring
Fixing buffer issues (when put is empty)