closes #2;Cleaned up code.