Cleaned up codes and modified start/stop function