Version 1.7 Added blank space handling and tweaked code