Finalised prodcons code