Implemented nuptake subroutine. Compiles but has runtime error (segmentation fault).