cleaned up a bit and updated interface