fuck stack, just appending code
basic to file writing added