made intermediate button functional: