Fixed the resolution function