finished parse_res function (change result from text to int)