Modified to pass tests