updated version with redstone trigger