added most of the other functionality