Simplified according to comments