Merged with formatting from latest version from lacostej