small changes from viliam's comments and updates