added test for rate limiting
added ratelimit function