cleaned up old code. converted project into into netbeans.
put in some minor changes and added some comments. also ran valgrind memcheck, looks good so far:

==16970== Memcheck, a memory error detector
==16970== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==16970== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==16970== Command: ./21-09-test
==16970== 
==16970== 
==16970== HEAP SUMMARY:
==16970==     in use at exit: 0 bytes in 0 blocks
==16970==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==16970== 
==16970== All heap blocks were freed -- no leaks are possible
==16970== 
==16970== For counts of detected and suppressed errors, rerun with: -v
==16970== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
started optimizing in functions.h
started optimizing
cleaner memory in functions.h
try to add restrict to pointer declarations
Merge pull request #19 from SebastianArnoldt/sebastian

Sebastian