Improve the limit function