Added luck & test
Added luck code
Added luck to write()