added most all functionality.