Please improve grammaticallity of the given sentence:
And sometimes, he sits on the top of the tower and gazes on the joist for a while.
And sometimes, he sits on the top of the tower and gazes at the joist for a while.