Cleaned up code and removed debugging code that it not needed.