improved chain parsing and setting
removed uneened function
renamed some stuff, see commit