first version of writing int/long values