After a brief stint as a scientific assistant to Professor Torkel Opsahl, he served as a magistrate for two and a half years at the Nes tributary office and subsequently obtained his lawyer's license .