Added a test program to figure out what has gone wrong. Test program works fairly well, so it will be built up slowly and migrated into the main executable