Updated functions to remove bugs. Updated solutions of project euler for better performance