added stuff from magnar