refactor and adding first shares calculation