updated pieces and fixed recursion problem