merged experimental code

also fixed some issues. started a small unit_tests file to test
individual functions