Simplified the bounds function.