added doubling functionality