minor 'fixes', though the code still doesn't work