added first version of subselects