Fixed minor issues, organized code.