incorporated changes suggested by Vasilis and synched it to the trunk with Pete's changes