Added new function and fixed the trailing spaces