Added fs extensions. Added function write