An applicable version with some bugs removed