added more stuff for mag and res