added all functionality except reset