added most functionality