reviewed first version, some minor errors fixed