ugly hack cinverting string into numerical, but working. looks OK but has to refactor all ugly bits