better modularity, can return positions