be at pains

meaning: to try very hard to do something (verb)

example:I was at pains to make my code perfect.

synonyms:take pains,