changed a few brackets, comments etc.