Sligth modifications as per suggestions from breznak