Implemented 3dfold