Update 3

not fully tested but seems to be working.