Removed debugging code and fixed formatting