fixed some code fragments