Using logic from LiquidSmooth and Alucard