adding controls. still needs optimization