Added cmd and cleaned up here and there.