refactored parts of pieCeption; fixed bugs