some small fixes + working simulator