Fix bugs
Clean up old codes