Refactored to include fput
Refactored to include fput and fget
Refactored to include fput and fget