Adding punker76's changes.