Removed the spaces in the code and also changed the code according to boud's suggestion in the review.