added file_put_contents and changed some methods to be more usable