add assignment solution(still have bugs on multiple pressing 'c' key)