fixed bug in conversion matrices to SLAP notation and cleaned up code