Original: From 1840 to 1842 he was a deputy judge in Moss District Court.
Simplified: From 1840 to 1842 he was a deputy judge at the Moss District Court in Moss.