Initial implementation of Shares algorithm