add support for controls. unsure if calculations are correct