bad code gets worse: implementation of the at()