An alternate implementation