Once again fixed alot of ugly code