work on shock (optimize and refactor)