Making changes suggested by Kirill and James