initial versions
working simulator